package pro.zfb.service.zfb.signature.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xiaoleilu.hutool.json.JSONObject;

import com.yy.kit.string.YYStrKits;
import pro.zfb.entity.TZfbSignature;
import pro.zfb.mapper.TZfbSignatureMapper;
import pro.zfb.service.zfb.signature.IZfbSignatureService;

@Service(value = "iZfbSignatureService")
public class ZfbSignatureServiceImpl implements IZfbSignatureService {

    private final TZfbSignatureMapper tZfbSignatureMapper;

    @Autowired
    public ZfbSignatureServiceImpl(TZfbSignatureMapper tZfbSignatureMapper) {
        this.tZfbSignatureMapper = tZfbSignatureMapper;
    }

    @Override
    @Transactional
    public void signature(JSONObject json, String status) {
        TZfbSignature sig = new TZfbSignature();
        sig.setOpenid(YYStrKits.getTableId());
        sig.setSignature_date(new Date());
        sig.setStatus(status);
        tZfbSignatureMapper.insert(sig);
    }

}
